﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralSearch.aspx.cs"
    Inherits="PPAP.Web.SearchReport.GeneralSearch" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <font size='-1' color='gray'>Current position:Report>>Status report</font>
        <table width="980px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="2">
                    &nbsp; Status report
                </td>
            </tr>
            <tr>
                <td style="width: 100%;" colspan="2">
                    <table>
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Created：
                            </td>
                            <td>
                                <cc1:My97 ID="txtCreateStart" runat="server"></cc1:My97>
                                --<cc1:My97 ID="txtCreateEnd" runat="server"></cc1:My97>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Document：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlDocument" runat="server">
                                    <asp:ListItem>All</asp:ListItem>
                                    <asp:ListItem Value="1">Ok</asp:ListItem>
                                    <asp:ListItem Value="0">Not ok</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5; text-align: right;" align="left">
                                Part：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlPart" runat="server">
                                    <asp:ListItem>All</asp:ListItem>
                                    <asp:ListItem Value="1">Ok</asp:ListItem>
                                    <asp:ListItem Value="0">Not ok</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Supplier name：
                            </td>
                            <td>
                                <asp:TextBox ID="txtSupper" autocomplete="off" runat="server" Width="315px"></asp:TextBox>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Q-engineer：
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtQE" autocomplete="off" runat="server" Width="230px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Status：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlStatus" runat="server" Width="155px">
                                    <asp:ListItem Value="All">All</asp:ListItem>
                                    <asp:ListItem Value="-1">Un-allocated</asp:ListItem>
                                    <asp:ListItem Value="0">Allocated</asp:ListItem>
                                    <asp:ListItem Value="1">Created</asp:ListItem>
                                    <asp:ListItem Value="2">Submitted</asp:ListItem>
                                    <asp:ListItem Value="3">Ready for sampling</asp:ListItem>
                                    <asp:ListItem Value="4">Not ready for sampling</asp:ListItem>
                                    <asp:ListItem Value="5">Circulating</asp:ListItem>
                                    <asp:ListItem Value="6">Released</asp:ListItem>
                                    <asp:ListItem Value="7">Decided</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Q-manager：
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtQM" autocomplete="off" runat="server" Width="230px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Inspection：
                            </td>
                            <td>
                                <table>
                                    <tr>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton1" runat="server" Text="Started" GroupName="a" />
                                        </td>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton2" runat="server" Text="Not started" GroupName="a" />
                                        </td>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton5" runat="server" Text="All" GroupName="a" Checked="True" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Approval：
                            </td>
                            <td colspan="3">
                                <table>
                                    <tr>
                                        <td style="width: 60px;">
                                            <asp:RadioButton ID="rbtWait" runat="server" Text="Wait" GroupName="c" />
                                        </td>
                                        <td style="width: 85px;">
                                            <asp:RadioButton ID="rbtApproved" runat="server" Text="approved" GroupName="c" />
                                        </td>
                                        <td style="width: 50px;">
                                            <asp:RadioButton ID="rbtApproved0" runat="server" Text="All" GroupName="c" Checked="True" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Overdue：
                            </td>
                            <td>
                                <table>
                                    <tr>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton3" runat="server" Text="Yes" GroupName="b" />
                                        </td>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton4" runat="server" Text="No" GroupName="b" />
                                        </td>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="RadioButton6" runat="server" Text="All" GroupName="b" Checked="True" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="font-weight: bold; color: #2E8AC5;" align="left">
                                Result：
                            </td>
                            <td colspan="3">
                                <table>
                                    <tr>
                                        <td style="width:60px;">
                                            <asp:RadioButton ID="rbtG" runat="server" Text="G" GroupName="d" />
                                        </td>
                                        <td style="width:85px;">
                                            <asp:RadioButton ID="rbtY" runat="server" Text="Y" GroupName="d" />
                                        </td>
                                        <td style="width:50px;">
                                            <asp:RadioButton ID="rbtR" runat="server" Text="R" GroupName="d" />
                                        </td>
                                        <td style="width:50px;">
                                            <asp:RadioButton ID="rbtR0" runat="server" Text="All" GroupName="d" Checked="True" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr style="height: 32px;">
                <td style="font-weight: bold; color: #2E8AC5;">
                    <asp:CheckBox ID="chkMycase" runat="server" Text="My case" />
                </td>
                <td align="right" style="padding-right: 30px;">
                    <asp:Button ID="btnSearch" runat="server" CssClass="button" Text="Search" OnClick="btnSearch_Click" />
                    &nbsp;<asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" AllowSorting="true" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server" OnSortCommand="dgList_SortCommand">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="No." FooterText="No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="pparno" SortExpression="pparno" HeaderText="PPAR No."
                    FooterText="PPAR No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartno" SortExpression="bdntpartno" HeaderText="Part No."
                    FooterText="Part No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartname" SortExpression="bdntpartname" HeaderText="Part name"
                    FooterText="Part name">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:BoundColumn DataField="color" SortExpression="color" HeaderText="Color" FooterText="Color">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qlevel" SortExpression="qlevel" HeaderText="Q/E level"
                    FooterText="Q/E level">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="suppliercode" SortExpression="suppliercode" HeaderText="Supplier code"
                    FooterText="Supplier code">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="suppliername" SortExpression="suppliername" HeaderText="Supplier name"
                    FooterText="Supplier name">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="remarks" Visible="false" HeaderText="Remark">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Status" FooterText="Status">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# ShowAuditStatus(Eval("status").ToString(),Eval("FINALSTATUS").ToString(),Eval("isinapp").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="FINALRESULT" SortExpression="FINALRESULT" HeaderText="Result"
                    FooterText="Result">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARVERSION" Visible="false" HeaderText="PPAR version">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Start date" SortExpression="ppardate" FooterText="Start date">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%#Eval("ppardate").ToString()==""?"":DateTime.Parse(Eval("ppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="End date" FooterText="End date" SortExpression="endtime">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%#Eval("endtime").ToString()==""?"":DateTime.Parse(Eval("endtime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"
                    HeaderText="View" FooterText="View">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" CssClass="tt" ToolTip='view' PostBackUrl='<%# "../Part/CreatPPARWeb.aspx?rid="+Eval("ID")+"&his=1" %>'
                            ImageUrl='../Images/newimg/see.png' runat="server" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" Width="100%" ShowPageIndexBox="Always"
            CssClass="paginator" PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
            HorizontalAlign="Center" PageSize="20" EnableTheming="true" AlwaysShow="True"
            FirstPageText="|&lt;" LastPageText="&gt;|" NextPageText="&gt;" PrevPageText="&lt;"
            SubmitButtonText="Go" TextAfterPageIndexBox="page" InvalidPageIndexErrorMessage="Page index is not effective numerical！"
            OnPageChanged="AspNetPager2_PageChanged" PageIndexOutOfRangeErrorMessage="Page index beyond range"
            BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
